<?php
$p = explode(',', $theme_options['featured_pages']);
$c = sizeof($p);
?>
<div class="f5box">
	<?php // DEFAULT MESSAGE
	if (!($theme_options['featured_pages']<>"")) {
		?>
			<div style="height:250px; text-align:center;">
				<p>&nbsp;</p>
				<h1>The theme has been activated.</h1>
				<p>Here is a section of <span class="highlight_green">Featured Pages</span>. Please, set a pages <code>(Admin Panel > Theme Settings > <br>Homepage > Featured Pages)</code> which will be shown here.
				Please, be carefull: each slide is one standalone page <br>e.g. if you'd like to add two slides you need to create two pages <code>(Admin Panel > Pages > Add New)</code> <br>and enter IDs of these pages to input field 
				on the Theme Settings panel.</p>
				<p><small style="color:#999">The slide's dimentions: Width is 880px, Height is 250px.</small></p>
			</div>
		<?php
		}
	else 
		{ ?>
		<div id="flowpanes6">
			<div class="items">
				<?php // GET IDs OF PAGES AND DISPLAY IT
				query_posts(array('post_type'=>'page','post__in'=>$p,'posts_per_page' => -1,'orderby' => 'menu_order','order' => 'ASC'));
				$f = 1;
				while (have_posts()) : the_post(); ?>
				<div class="item">
					<div id="fragment-<?php echo $f++ ?>">
						<?php the_content(); ?>
						<div class="clear"><!-- --></div>
					</div>
				</div>
				<?php endwhile; wp_reset_query(); ?>
			</div>
		</div><!-- end flowpanes -->
	<?php } ?>
	<div id="bottom_cover"><!-- --></div>

	<?php // DISPLAY TABS
	if ($c > 1) { ?>
	<ul class="ui-tabs-nav tabs-thumbs none">
	<?php $count = 0 ?>
		<?php
			query_posts(array('post_type'=>'page','post__in'=>$p,'posts_per_page' => -1,'orderby' => 'menu_order','order' => 'ASC'));
		$f = 1;
		while (have_posts()) : the_post(); ?>
		<li>
			<a href="#fragment-<?php echo $f++ ?>">
				<span>
					<span><!-- --></span><img src="<?php bloginfo('template_directory'); ?>/images/zero.gif" width="20" height="20" alt="no image"/>
				</span>
			</a>
		</li><?php $count++ ?>
		<?php endwhile; wp_reset_query(); ?>
	</ul>
	<div id="ft" class="none"><!-- --></div>
	<?php // CALCULATE MARGIN
	$x = 20 * $count;
	$margin = 14 + $x;
	?>
	<style type="text/css">ul.tabs-thumbs { margin:-<?php echo $margin ?>px 3px 0 auto; }</style>
	<!--[if IE 7]><style type="text/css">ul.tabs-thumbs { margin:-<?php $iem = $margin+15; echo $iem; ?>px 3px 0 auto; }</style><![endif]-->
	<?php ;} ?>
</div>